<script>
	import {mapMutations,mapState} from "vuex"
	export default {
		onLaunch: function() {
			// console.log('App Launch')
			if(uni.getStorageSync("token")){
				this.getUser()
			}
			
		},
		onShow() {
			let backTime=new Date().getTime();
			if(backTime-this.leaveTime>5000){
				uni.navigateTo({
					url: '/pages/advertise/advertise'
				});
			}
		},
		onHide(){
			this.$store.commit("leavePage");
			
		},
		computed:{
			...mapState(["leaveTime"])
		},
		methods:{
			...mapMutations(["getUser"]),
		},

	}
</script>

<style lang="scss">
	/*每个页面公共css */
	// @import "@/common/css/common.scss";
	// @import "@/common/css/iconfont.css";
	@import "./common/css/common.scss";
	@import "./common/css/iconfont.css";
</style>